const { defineConfig } = require('@vue/cli-service')
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
module.exports = defineConfig({
  configureWebpack: {
    plugins: [new NodePolyfillPlugin()],
  },
  devServer: {
    port: 8777,
    allowedHosts: [
      'hk23790725.zicp.fun', // 允许访问的域名地址，即花生壳内网穿透的地址 http://hk23790725.zicp.fun:47545/
      '.zicp.fun'   // .是二级域名的通配符
    ],
    proxy: {
      "/apis": {
        target: "http://127.0.0.1:8090/yandeApi",
        changeOrigin: true,
        ws: true,
        pathRewrite: {
          '^/apis': ''
        }
      }
    }

  },
  transpileDependencies: true
})
